package com.school.admin.common.handler;

import lombok.Getter;

@Getter
public enum GlobalExceptionEnum {
    /**
     * 登录失败
     */
    LOGIN_FAILED(50001, "登录失败"),
    /**
     * 未知错误
     */
    UNKNOWN_REASON(50000, "未知错误"),
    /**
     * 保存失败
     */
    SAVE_FAILED(50002, "保存失败"),
    /**
     * 更新失败
     */
    UPDATE_FAILED(50003, "更新失败"),
    /**
     * 查询失败
     */
    QUERY_FAILED(50004, "查询失败"),
    /**
     * 删除失败
     */
    FAILED_TO_DELETE(50005, "删除失败"),
    /**
     * 导入失败
     */
    IMPORT_FAILED(50006, "导入失败"),
    /**
     * token失效
     */
    TOKEN_INVALIDATION(50008, "token失效"),
    /**
     * token认证失败
     */
    TOKEN_AUTHENTICATION_FAILED(50009, "token认证失败"),
    /**
     * 以在其他地方登录
     */
    TO_LOG_IN_ELSEWHERE(50010, "以在其他地方登录"),
    /**
     * 更新token
     */
    BE_OVERDUE_TOKEN(50011, "更新token"),

    /**
     * 操作评率过高
     */
    OPERATING_FREQUENCY_IS_TOO_HIGH(50012, "操作评率过高"),

    LOGIN_TOO_MANY_ERRORS(50013, "密码错误次数过高");


    private Integer code;

    private String message;

    GlobalExceptionEnum(Integer code, String message) {

        this.code = code;
        this.message = message;
    }
}
